<?php 
include("../../conexion.php");

$sql =mysql_query("SELECT * FROM ingreso_cartas",$conn) or die(mysql_error());

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../../includes/css/jquery-ui-notarios.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" type="text/css" href="../../tcal.css" />
<link href="../../includes/css/jquery-ui-notarios.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" type="text/css" href="../../includes/css/uniform.default.min.css" />



<script language="JavaScript" type="text/javascript" src="../../ajax.js"></script>
<script type="text/javascript" src="../../tcal.js"></script> 
<script type="text/javascript" src="../includes/Mantenimientos.js"></script> 
<script src="../../js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../includes/jquery-1.8.3.js"></script>
<script src="../../includes/js/jquery-ui-notarios.js"></script>
<script src="../../includes/jquery.uniform.min.js"></script>
<script type="text/javascript" src="../../tcal.js"></script> 


<title>Untitled Document</title>
<style type="text/css">
<!--
.titubuskar {
	font-family: Calibri;
	font-size: 12px;
	font-weight: bold;
	font-style: italic;
	color: #003366;
}
.titubuskar0 {font-family: Calibri; font-size: 12px; font-style: italic; font-weight: bold; color: #333333; }
.titubuskar1 {color: #333333}
.reskar2 {font-family: Calibri; font-size: 13px; font-weight: bold; font-style: italic; color: #003366; }
.reskar {font-size: 12px; font-style: italic; color: #333333; font-family: Calibri;}
-->
</style>

<script type="text/javascript">
$(document).ready(function(){
cargakardex(0)
	});
	
function cargakardex(limite)
{
	var url="busqueda_viajes.php";
	$.post(url,{estado : "1",limite: limite},function (responseText){
		    $("#bkardex").html(responseText);
			
	  });
}



function buscaPERMIVIAJE(){
	
	var _numformu 		= $('#numformu').val();
	var _participante	= $('#participante').val();
	var _rango1		    = $('#rango1').val();
	var _rango2  	    = $('#rango2').val();
	var _tippersona     = $('#tippersona').val();
	var _nro			= $('#nrocontrol').val();
	
	if(_numformu=='' && _participante=='' && _rango1=='' && _rango2=='' &&  _tippersona=='' && _nro=='')
	{
		var limite     = 0;
		var _estado    = "1";	 
	}
	else if(_numformu!='' || _participante!='' || _rango1!='' || _rango2!='' ||  _tippersona!='' || _nro!=''){
		var limite     = 0;
		var _estado    = "2"; 
		
		}
	
	var _data = 
	{
		numformu 		: _numformu,
		participante	: _participante,
		rango1			: _rango1,
		rango2   		: _rango2,
		tippersona		: _tippersona,
		nrocontrol		: _nro,
		estado			: _estado,
		limite          : limite
	}
	$('#bkardex').load("busqueda_viajes.php",_data);
	
	return false;
	
	}

</script>
</head>

<body>
<table width="858" border="0" cellspacing="0" cellpadding="0">
<tr>
  <td width="20"><table width="858" border="0" cellspacing="0" cellpadding="0">
    <tr></tr>
    <tr></tr>
    <tr></tr>
    <tr>
      <td width="20"><span class="reskar2">Busqueda Por:</span></td>
      <td width="58">&nbsp;</td>
      <td width="25">&nbsp;</td>
      <td width="62" align="right">&nbsp;</td>
      <td width="72">&nbsp;</td>
    </tr>
    <tr>
      <td><form name="frmbuscakardex" method="post" action="">
        <table width="837" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="62" align="right"><span class="titubuskar0">N° Crono :</span></td>
            
            <td width="72"><span class="titubuskar0">
              <input name="numformu" type="text" id="numformu" size="12" />
            </span></td>
            <td width="22">&nbsp;</td>
               <td width="126"><span class="titubuskar0">
            <select name="tippersona" id="tippersona" class="input-mediun" 		onchange="buscaPERMIVIAJE()">
            <option value ="" selected="selected">TIPO PERMISO</option>
            <option value="001">Interior</option>
            <option value="002">Exterior</option>
          </select>
            </span></td>
            <td width="124" align="right"><span class="titubuskar0">
             Nombre Participante :</span></td>
            <td width="202"><label>
                           <input style="text-transform:uppercase;" name="participante2" type="text" id="participante" size="30" />
            </label></td>
            
             <td width="89" align="right"><span class="titubuskar0">
             Nro Control :</span></td>
            <td width="140"><label>
                           <input style="text-transform:uppercase;" name="nrocontrol2" type="text" id="nrocontrol" size="10" />
            </label></td>
            
          </tr>
          <tr>
            <td width="62">&nbsp;</td>
            <td width="72">&nbsp;</td>
            <td width="22"><span class="titubuskar0">
       
            </span></td>
            
          </tr>
        </table>
        
        <table>
        <tr>
          <td width="160"><span class="reskar2">Busqueda por Fecha Crono.:</span></td>
      	</tr>
      </table>
      
      <table width="603">
           <tr>
         
         
            <td width="103" align="right"><span class="titubuskar0">Desde:</span></td>
            <td width="88"><span class="titubuskar0">
              <input name="rango1" type="text" id="rango1" class="tcal" style="text-transform:uppercase"  size="10" />
            </span></td>
            <td width="10">&nbsp;</td>
            <td width="53" align="center"><span class="titubuskar0">Hasta</span></td>
            <td width="120"><label>
                           <input name="rango2" type="text" id="rango2" class="tcal" style="text-transform:uppercase"  size="10" />
            </label></td>
               <td width="201" align="left"><label><a onclick="buscaPERMIVIAJE()"><img src="../../iconos/buscarclie.png" width="72" height="29" border="0" /></a>
            </label></td>
            
           </tr>
      </table>
      </form></td>
    </tr>
    <tr>
      <td colspan="2">----------------------------------------------------------------------------------------------------------------------------------------------------</td>
    </tr>
    <tr>
      <td colspan="2"><div id="gennn" style="width:860px; height:690px; overflow:auto;">
        <table width="200" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><table width="880" border="1" cellpadding="0" cellspacing="0" bordercolor="#333333" bgcolor="#CCCCCC">
              <tr>
                <td width="30" align="center"><span class="titubuskar0">Nro Control</span></td>
                <td width="60" align="center"><span class="titubuskar0">Cronologico</span></td>
                <td width="236" style="max-width:150px;" align="center"><span class="titubuskar0">Referencia/Participante</span></td>
                <td width="86" align="center"><span class="titubuskar0">Fecha Crono.</span></td>
                <td width="150" align="center"><span class="titubuskar0">Tip.Permiso</span></td>
                <td width="86" align="center"><span class="titubuskar0">Fec. Ingreso</span></td>
                <td width="86" align="center"><span class="titubuskar0">Descripcion</span></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td><div id="bkardex">

            </div></td>
          </tr>
        </table>
      </div></td>
    </tr>
  </table>    <span class="reskar2"></span></td>
</tr>
</table>
</body>
</html>



